package main

import "fmt"

func moveZeroes(nums []int) {
	slow := 0
	for _, num := range nums {
		if num != 0 {
			nums[slow] = num
			slow++
		}
	}
	for slow < len(nums) {
		nums[slow] = 0
		slow++
	}
}

func main() {
	nums := []int{0, 1, 0, 3, 12}
	moveZeroes(nums)
	for _, num := range nums {
		fmt.Println(num)
	}
}
